package com.lin.linchatgpt.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Copyright(C),2022年-2022,霖霖
 *
 * @author 霖霖
 * @version 1.0
 * @date 2023/6/15 18:53
 * @Description WebMVC配置
 */
@Configuration
public class WebSpringMVCConfig implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")//设置允许跨域的路径
                .allowedOriginPatterns("*")
                .allowedMethods("*")
                .allowCredentials(false)
                .allowedHeaders("*");

    }
}
